package com.example.homeworkmutualevaluation.Controller;

import com.example.homeworkmutualevaluation.Service.BulletinService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/public")
public class PublicController {
    @Resource
    private BulletinService bulletinService;
    @PostMapping("/get_bulletins")
    public Map<String, Object> getBulletins() {
        HashMap<String, Object> response = new HashMap<>();
        response.put("code", 1);
        response.put("data", bulletinService.findAll());
        return response;
    }
}
